<cfcomponent extends="queries">
    
    <!---Need to call BASE functions--->
    <cfset BASE = CreateObject("component", "base") />
    
    
        
	<!--- Employee Step Detail --->
    <cffunction name="funcGetStepDetail" returntype="query">
        
        <cfquery datasource="#Session.DataSource#" name="qryGetStepDetail">
			<!---scf_GetStepDetail - old scott store procedure--->
            SELECT * 
            FROM Steps 
            Where AssignedDeptID is not null And OrderNo < 100 
            Order by OrderNo
		</cfquery>
        
    	<cfreturn qryGetStepDetail />
    </cffunction>
    <!--- Employee Step Detail --->
            
    
    
    <!--- Insert Employee --->
    <cffunction name="funcStep1InsertEmployee" returntype="boolean">
    	<cfargument default="" name="FORM" required="yes" />
        
        <cfquery name="qryStep1InsertEmployee" datasource="#Session.DataSource#">                                
                INSERT INTO Employee 
                	(
                    First,PreferredName, Middle,Last,HomePhone, CellPhone, WorkPhone, WorkPhoneExt, PhonePrimaryID, Email, Address1, Address2,City, 
                    State,ZIP, PostingID,SupervisorID,DeptID,MirrorAccountID,DeskPhone,BadgeAccessLevelID,TimeCardApprs, 
                    ContainerID,CostCode,Benifits,Leave,LunchID<!------>
                    )
                VALUES 
                	(   
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.First)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Preferred)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.MI)#'/>, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Last)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#BASE.CleanPhone(trim(ARGUMENTS.FORM.HomePhone))#'  />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#BASE.CleanPhone(trim(ARGUMENTS.FORM.CellPhone))#'/>, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#BASE.CleanPhone(trim(ARGUMENTS.FORM.WorkPhone))#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#BASE.CleanPhone(trim(ARGUMENTS.FORM.WorkPhoneExt))#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#trim(ARGUMENTS.FORM.PhonePrimaryType)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#lcase(trim(ARGUMENTS.FORM.Email))#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Address1)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Address2)#'  />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.City)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.State#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Zip)#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.Position#' />,
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#Session.arrEmpInfo.MasterID#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.Dept#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.Mirror#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.FORM.Phone#' />, 
                        <cfif isDefined("ARGUMENTS.FORM.Access")>
                        	<cfqueryparam cfsqltype="cf_sql_varchar" value='#ARGUMENTS.FORM.Access#' />, 
                        <cfelse>
                        	<cfqueryparam cfsqltype='cf_sql_varchar' value='0' />, 
                        </cfif>                        
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.FORM.TimeCardAppr#' />, 
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.Container#' />, 
                        <cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.FORM.CostCode#' />, 
                        <cfif isDefined("ARGUMENTS.FORM.Benefits")>
                        	<cfqueryparam cfsqltype='cf_sql_bit' value='1' />, 
                        <cfelse>
                        	<cfqueryparam cfsqltype='cf_sql_bit' value='0' />, 
                        </cfif>
                        <cfif isDefined("ARGUMENTS.FORM.Leave")>
                        	<cfqueryparam cfsqltype='cf_sql_bit' value='1' />, 
                        <cfelse>
                        	<cfqueryparam cfsqltype='cf_sql_bit' value='0' />, 
                        </cfif>                                                
                        <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.Lunch#' /><!--- --->
                    )               
                SELECT @@Identity AS NewID            
            </cfquery>
			
            <cfset SUPER.funcInsertAction(qryStep1InsertEmployee.NewID, 1, Session.intUserRosettaID, replace(trim(ARGUMENTS.FORM.Comments),"'","''","all")) />
            <cfset SUPER.funcInsertAction(qryStep1InsertEmployee.NewID, 2) />
            
    	<cfreturn True />
    </cffunction>
    <!--- Insert Employee --->
    
    
    
          
</cfcomponent>